In an existing read/write cache (Cache) in the industry, a used storage medium is usually based on a Non-Volatile Dual In-line Memory Module (NVDIMM) or a non-volatile random access memory (Non-Volatile Random Access Memory, NVRAM). However, if the storage medium is based on the foregoing devices, the write cache usually has a relatively small capacity and has difficulty in dealing with a scenario of heavy random write pressure.
In the prior art, a flash (Flash) device is used as a cache. To ensure data security, IO needs to be performed twice for each write request, one is IO for writing data, and the other is IO for writing metadata. A lifetime of the flash is directly related to write times. For example, a multi-level cell (Multi-Level Cell, MLC) flash is usually written for only approximately 5000 to 10000 times. A size of the metadata is usually between 30 B and 64 B. If IO is directly performed on each piece of metadata according to the size of the metadata, performance of the flash cannot be given full play. If IO is performed on the metadata that is aligned according to 4 K, a write amplification problem may exist, and the lifetime of the entire flash is significantly affected.